﻿$(document).ready(function(){
	//kiem tra form
  	$('form').validationEngine();
  	//end kiem tra form
	/** Tooltip*/
   $('.tooltip').tooltip({ 
      track: true, 
      delay: 0, 
      showURL: false, 
      showBody: ' |t| '
   });
	 //lazy load
//	$("img").lazyload({
////	     event: "scrollstop",
//	     effect: "fadeIn"
//	});
	$("#search form input").focus(function(){
		$("#search form button").css({
			color:"#fff",
			backgroundColor:"#FB9337",
			borderColor:"#ff8800"
		});
		$(".tabTypeSearch a.tabSearchActive").css({
			backgroundColor:"#ffffcf",
			borderColor:"#ff8800"
		});
	});
	$("#search form input").focusout(function(){
		$("#search form button").css({
			color:"#777",
			backgroundColor:"#f0f0f0",
			borderColor:"#d0d0d0"
		});
		$(".tabTypeSearch a.tabSearchActive").attr("style","");
	});
	$(".tabTypeSearch a").click(function(){
		$(".tabSearchActive").removeClass("tabSearchActive");
		$(this).addClass("tabSearchActive");
		return false;
	});
	//show popup manage account
	$("#btGetBoxManageAccount").click(function(e){
		$("#popupManageAccount").stop(true,true).fadeIn("slow");
		e.preventDefault();
		return false;
	});
	$("#popupManageAccount").click(function(e){
		e.stopPropagation();
	});
	$("html,body").click(function(){
		$("#boxLogin,#boxFeedBack").stop(true,true).center().fadeOut("slow");
		$("#wrapLogin,#wrapFeedBack,#popupManageAccount").hide();
	});
	//show box FeedBack
	$("#btGetBoxFeedBack").click(function(e){
		$("#wrapFeedBack").show();
		$("#boxFeedBack").stop(true,true).center().fadeIn("slow");
		e.preventDefault();
		return false;
	});
	$("#boxFeedBack").click(function(e){
		e.stopPropagation();
	});
});